package com.hzy.friend.controller.remote;

import com.hzy.friend.api.UserApi;
import com.hzy.friend.entity.User;
import com.hzy.friend.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
* 请替换User介绍 controller
*
* @author: 请替换作者
* @version: 1.0
* @datetime: 2019-03-01 17:33:27
*/
@RestController
public class UserApiImpl implements UserApi {

    @Autowired
    private UserService userService;

    @Override
    public void save(@RequestBody User user) throws Exception {
        userService.save(user);
    }

    @Override
    public void modify(@RequestBody User user) throws Exception {
        userService.modify(user);
    }

    @Override
    public void remove(@RequestBody User user) throws Exception {
        userService.remove(user);
    }

    @Override
    public void resort(@RequestBody User user) throws Exception {
        userService.resort(user);
    }

    @Override
    public User findById(@RequestBody User user) throws Exception {
        return userService.findById(user.getUserId());
    }

    @Override
    public List<User> find(@RequestBody User user) throws Exception {
        return userService.find(user);
    }
}
